#include <stdio.h>

#define MAX_SIZE 50

int main(int argc, char *argv[])
{
	int m, n, p, i, j, len;
	int a[MAX_SIZE];

	scanf("%d %d", &m, &n);

    for (i=0; i<m; i++) a[i] = i + 1;

    p = 0;
    for (i=m; i>0; i--) {
        p = (p + n - 1) % i;
        printf("[%d]: %d\n", p, a[p-1]);
    }

	return 0;
}
